using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;

namespace DIS_DAO.DTO
{
	/// <summary>
	/// Data transfer object which is associated with Customer table in database
	/// </summary>
	public class CustomerDTO
	{
		public int ID { get; set; }
		public string Name { get; set; }
		public string Phone { get; set; }
		public string Address { get; set; }
		public string Email { get; set; }
		public string UserName { get; set; }
		public string Password { get; set; }

		public static CustomerDTO Translate(DataRow row)
		{
			var dto = new CustomerDTO
			{
				ID = int.Parse(row["ID"].ToString()),
				Name = row["Name"].ToString(),
				Phone = row["Phone"].ToString(),
				Address = row["Address"].ToString(),
				Email = row["Email"].ToString(),
				UserName = row["UserName"].ToString(),
				Password = row["Password"].ToString(),
			};
			return dto;
		}
	}
}